package adapters;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.LayoutInflater;

import java.util.List;

/**
 * Created by Administrator on 2018/5/8.
 */

public class TakeAndReturnViewPagerAdapter extends FragmentPagerAdapter {

    private List<Fragment> list;
    private List<String> titles;
    private LayoutInflater mInflater;

    public TakeAndReturnViewPagerAdapter(FragmentManager fm, List<Fragment> list, List<String> titles, Context mContext) {
        super(fm);
        this.list = list;
        this.titles = titles;
        mInflater=LayoutInflater.from(mContext);
    }

    @Override
    public Fragment getItem(int position) {
        return list.get(position);
    }

    @Override
    public int getCount() {
        return list.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return titles.get(position);
    }
}
